<%@ include file="/view/template/header.jsp"%>
<div id="content">
	<%@ include file="/view/ehr/ehr_common.jsp"%>
	<div class="right-content">
	<h3><s:if test='replyMessage.message!="empty"'>
					<s:property value="replyMessage.message"/>
			</s:if></h3>
			
		<s:form action="update_patient_form" method="post">
			<div class="box">
			
				<h1><s:label key="label.patient.update_patient" cssClass="label_text"></s:label></h1>

				<div id="tabs">
					<ul>
						<li><a href="#tabs-1"><s:label key="label.personal_details" cssClass="label_text"> </s:label></a></li>
						<li><a href="#tabs-2"><s:label key="label.contact_details" cssClass="label_text"> </s:label></a></li>
					</ul>
					<div id="tabs-1">
						<div class="sub_box">
						
						<div class="con-part">
								<span> <s:label key="label.patient.patientId" cssClass="label_text"></s:label><img name="required" src="<% out.print(baseURL);%>/view/required.jpg" width="15" height="20" alt="required" /> </span>
								
								<s:textfield name="patientDetails.patient.patientId" class="input-text" cssErrorClass="error" readonly="true"></s:textfield>
						
						</div>
							
							<div class="con-part">
								<span> <s:label key="label.patient.prefix" cssClass="label_text"> </s:label> </span>
								<s:select name="patientDetails.patient.prefix" list="#{'Rev.': 'Rev.', 'Dr.': 'Dr.', 'Mr.': 'Mr.', 'Mrs.': 'Mrs.', 'Miss.': 'Miss.'}"
									headerKey="0" headerValue="---Select Prefix---"
									class="select_box" cssErrorClass="error">
								</s:select>
							</div>
							
							<div class="con-part">
								<span> <s:label key="label.patient.givenName" cssClass="label_text"></s:label><img name="required" src="<% out.print(baseURL);%>/view/required.jpg" width="15" height="20" alt="required" /> </span>
								<s:textfield name="patientDetails.patient.givenName" class="input-text" cssErrorClass="error"></s:textfield>
								<s:fielderror cssStyle="errorMessage"> <s:param value="%{'patientDetails.patient.givenName'}" /> </s:fielderror>
							</div>
							
							<div class="con-part">
								<span> <s:label key="label.patient.familyName" cssClass="label_text"></s:label> </span>
								<s:textfield name="patientDetails.patient.familyName" class="input-text" cssErrorClass="error"></s:textfield>
							</div>

							<div class="con-part">
								<span> <s:label key="label.patient.gender" cssClass="label_text"></s:label> </span>
								<s:radio name="patientDetails.patient.gender" list="#{'1': 'Male', '2': 'Female'}" cssClass="input-radio" cssErrorClass="error" />
							</div>

							<div class="con-part">
								<span> <s:label key="label.patient.dob" cssClass="label_text"></s:label> </span>
								<s:textfield name="patientDetails.patient.birthTime" id="datetimepicker" class="input-text" cssErrorClass="error"></s:textfield>
							</div>

							<div class="con-part">
								<span> <s:label key="label.patient.nic" cssClass="label_text"></s:label> </span>
								<s:textfield name="patientDetails.patient.nicNo" class="input-text" cssErrorClass="error"></s:textfield>
								<s:fielderror cssStyle="errorMessage"> <s:param value="%{'patientDetails.patient.nicNo'}" /> </s:fielderror>
							</div>

							<div class="con-part">
								<span> <s:label key="label.patient.birthPlace" cssClass="label_text"></s:label> </span>
								<s:textfield name="patientDetails.patient.birthPlaceAddress" class="input-text" cssErrorClass="error"></s:textfield>
							</div>

							<div class="con-part">
								<span> <s:label key="label.patient.maritialStatus" cssClass="label_text"></s:label> </span>
								<s:radio name="patientDetails.patient.maritialStatus" list="#{'1': 'Single', '2': 'Married'}" cssClass="input-radio" cssErrorClass="error" />
							</div>

							<div class="con-part">
								<span> <s:label key="label.patient.religion" cssClass="label_text"></s:label> </span>
								<s:select name="patientDetails.patient.religiousAffliationId"
									list="#{'1': 'Buddhism', '2': 'Muslim', '3': 'Hindu', '4': 'Other'}" headerKey="0"
									headerValue="---Select Religion---"
									class="select_box" cssErrorClass="error">
								</s:select>
							</div>

							<div class="con-part">
								<span> <s:label key="label.patient.ethnicGroup" cssClass="label_text"></s:label> </span>
								<s:select name="patientDetails.patient.ethnicGroupId"
									list="#{'1': 'Sinhalese', '2': 'Muslim', '3': 'Tamil', '4': 'Other'}" headerKey="0"
									headerValue="---Select Ethnic Group---" 
									cssErrorClass="error">
								</s:select>
							</div>
						</div>
					</div>

					<div id="tabs-2">
						<div class="sub_box">
							<h2><s:label key="label.address" cssClass="label_text"></s:label></h2>
							
							<div class="con-part">
								<span> <s:label key="label.address.houseNo" cssClass="label_text"></s:label> </span>
								<s:textfield name="patientDetails.patientAddressList.houseNumber" class="input-text" cssErrorClass="error"></s:textfield>
							</div>

							<div class="con-part">
								<span> <s:label key="label.address.streetName" cssClass="label_text"></s:label> </span>
								<s:textfield name="patientDetails.patientAddressList.street" class="input-text" cssErrorClass="error"></s:textfield>
							</div>

							<div class="con-part">
								<span> <s:label key="label.address.city1" cssClass="label_text"></s:label> </span>
								<s:textfield name="patientDetails.patientAddressList.city1" class="input-text" cssErrorClass="error"></s:textfield>
							</div>

							<div class="con-part">
								<span> <s:label key="label.address.city2" cssClass="label_text"></s:label> </span>
								<s:textfield name="patientDetails.patientAddressList.city2" class="input-text" cssErrorClass="error"></s:textfield>
							</div>

							<div class="con-part">
								<span> <s:label key="label.address.country" cssClass="label_text"></s:label> </span>
								<s:select name="patientDetails.patientAddressList.country" list="#{'1': 'Sri Lanka', '2': 'USA.', '3': 'India', '4': 'Australia', '5': 'Other'}"
								 headerValue="---Select Country---" headerKey="0" 
								 class="select_box" cssErrorClass="error">
								</s:select>
							</div>

							<div class="con-part"></div>
							<div class="clear-both"></div>
							
							
							<div class="con-part">
								<span> <s:label key="label.patient.email" cssClass="title_label_text"></s:label> </span>
								<s:textfield name="email"  class="input-text" cssErrorClass="error"></s:textfield>
								<s:fielderror cssStyle="errorMessage"> <s:param value="%{'patientDetails.patientEmailList.email'}" /> </s:fielderror>
							</div>
							
							
							<div class="con-part">
								<span> <s:label key="label.patient.telephone" cssClass="title_label_text"></s:label> </span>
								<s:textfield name="telephoneNo" class="input-text" cssErrorClass="error"></s:textfield>
								<s:fielderror cssStyle="errorMessage"> <s:param value="%{'patientDetails.patientTelephoneList.telephoneNo'}" /> </s:fielderror>
							</div>
							
						</div>
					</div>
					
					<div class="button_bar2">
						<s:submit cssClass="green" name="updatePatient.update" type="button" />
					</div>
				</div>
		</s:form>
	</div>
</div>

<%@ include file="/view/template/footer.jsp"%>

<script type="text/javascript"
	src="<%out.print(baseURL);%>/view/template/js/jquery-ui-timepicker-addon.js"></script>
<script>
	$(function() {
		$("#tabs").tabs();
	});
	$(function() {
		$('#datetimepicker').datetimepicker();
	});
</script>

